﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbrella.Whs.SharePoint;

namespace Umbrella.Whs.WhsAddin.Wizards.SharePointInstallation
{
    internal class InstallStepConfigureSearch : IInstallStep
    {
        public string Title
        {
            get { return Resources.txtConfiguringSearch; }
        }

        public int Weight
        {
            get { return 60; }
        }

        public void PerformInstall()
        {
            var sa = SharePointServiceAccount.Load();

            var pi = new RunStsAdm(
                "-o spsearch -action start -farmserviceaccount " + sa.UserName + " -farmservicepassword " + sa.Password.ToClrString() + " -databasename WSS_Search"
                );

            pi.Run();
        }
    }
}
